<?php require_once '../plantilla/Guardado/consultarEnc.php';?>
<html lang="es">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="style/images/favicon.png" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/color/red.css" media="all" />
<link rel="stylesheet" type="text/css" media="screen" href="style/css/prettyPhoto.css"  />
<link rel="stylesheet" type="text/css" href="style/type/museo.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/type/ptsans.css" media="all" />
<link rel="stylesheet" type="text/css" href="style/type/charis.css" media="all" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/css/ie7.css" media="all" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/css/ie8.css" media="all" />
<![endif]-->
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="style/css/ie9.css" media="all" />
<![endif]-->
<script type="text/javascript" src="style/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="style/js/ddsmoothmenu.js"></script>
<script type="text/javascript" src="style/js/transify.js"></script>
<script type="text/javascript" src="style/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="style/js/jquery.superbgimage.min.js"></script>
<script type="text/javascript" src="style/js/jquery.slickforms.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
	$('.forms').dcSlickForms();
});

function boton_aparecer(id) {
      
       var boton = document.getElementById(id);
       if(boton.style.display == 'block')
          boton.style.display = 'none';
       else
          boton.style.display = 'block';
}
</script>
</head>
<body>
<!-- Begin Wrapper -->
<div id="wrapper">
  <div id="header">
    <div class="logo opacity"><a href="index.html">AutoGuayana, C.A</a></div>
  </div>
  <div class="clear"></div>
  <!-- Begin Menu -->
  <div id="menu" class="menu opacity">
    <ul>
     
      <li><a href="index.php">Cerrar Sesión</a></li>
    </ul>
    <br style="clear: left" />
  </div>
  <!-- End Menu --> 






  <!-- Begin Container -->
  <div id="container" class="opacity"> 
    <!-- Begin Content -->
    <div class="content">     
        <h2>Registrar Venta</h2>
        <form class="forms" method="post" action="Guardado/buscarByID.php">
            
                <input type="numeric" name="ci_cliente" placeholder="CI Cliente" class="text-input required"/>
                <button type="submit" class="btn-submit" name="buscar">
                    Verificar
                </button>
                <br/><br/>
        </form>
        <form class="forms" method="POST" action="Guardado/guardarVenta.php">
                <fieldset>
                    <ol>
                        <li class="form-row text-input-row">
                            <label><strong>ID Empleado</strong></label>
                            <input type="numeric" name="ID_emp" placeholder="001" class="text-input required" required/>
                        </li>
                        <li class="form-row text-input-row">
                            <label><strong>ID Vehículo</strong></label>
                            <input type="numeric" name="ID_vehiculo" placeholder="050" class="text-input required" required/>
                        </li>
                        <li class="form-row text-input-row">
                            <label><strong>ID accesorio</strong></label>
                            <input type="numeric" name="ID_acce" placeholder="123" class="text-input"/>
                        </li>
                        <li class="form-row text-input-row">
                            <label><strong>Cédula cliente</strong></label>
                            <input type="numeric" name="CI_cliente" placeholder="23503164" class="text-input required" required/>
                        </li>
                        <li class="form-row text-input-row">
                            <label><strong>Impuesto</strong></label>
                            <input type="numeric" name="impuesto" placeholder="1250" class="text-input required" required/>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Costo Licencia</strong></label>
                            <input type="numeric" name="costo_impuesto" placeholder="23503164" class="text-input required" required/>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Cantidad Accesorio</strong></label>
                            <input type="numeric" name="cant" placeholder="1, 2 ..." class="text-input"/>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Precio Accesorio</strong></label>
                            <input type="numeric" name="precio_acce" placeholder="1250" class="text-input"/>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Financiado</strong></label>
                            <input type="text" name="financiamiento" placeholder="Nombre del banco (Opcional)" class="text-input"/>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Precio venta</strong></label>
                            <input type="numeric" name="precio" class="text-input required" required/>
                        </li>
                        <li class="form-row text-input-row">
                            <label><strong>Tipo pago</strong></label>
                            <p>
                               Crédito <input type="radio" name="tp" value="Credito" required/>
                               Contado <input type="radio" name="tp" value="Contado" required/>
                            </p>
                        </li> 
                        <li class="form-row text-input-row">
                            <label><strong>Método pago</strong></label>
                            <p>
                               Efectivo <input type="radio" name="mp" value="E" />
                               Débito <input type="radio" name="mp" value="D" />
                               Crédito <input type="radio" name="mp" value="C" />
                            </p>
                        </li> 
                        <br/>
                   <div class="content">     
                        <h2>Agregar encuesta a la factura</h2>     
                         <div class="form-group">
                             <label>
                               Escoge:
                             </label>
                             <select class="form-control" name="idenc">
                                 <?php
                                 while ($linea = pg_fetch_array($query)) { ?>
                                       <option value='<?php echo $linea[0] ?>'><?php echo $linea[1] ?></option>

                                     
                                <?php }
                                 ?>
                             </select>
                           </div>
                   </div>
                        <button style="alignment-adjust: central" type="submit" class="btn-submit" name="enviar">
                                Generar Factura
                        </button>
                        <br/>
                        </ol>
                </fieldset>
            </form>
            <br/>
<!--            <form class="forms" method="POST" action="Guardado/generarFactura.php">
                <fieldset>
                    <ol>
                        <button id="fact" style="alignment-adjust: central;" type="submit" class="btn-submit" name="enviar" onclick="boton_aparecer('verPDF')" hidden="true">
                            Facturar
                        </button>
                    </ol>    
                </fieldset>    
            </form>-->
            <br/><br/>
              <a id="verPDF" href="reportes/facturaCompra.pdf" hidden="true"> Ver Factura</a>           
            <div class="response"></div>
    </div>
    <!-- End Content -->  
    
   <!-- Begin Sidebar -->
    <div class="sidebar">
      <div class="sidebar-box">
        <div class="cat-list">
          <ul>        
            <h4>Clientes</h4>
            <li><a href="agregarCliente.php">Agregar cliente</a></li>
            <h4>Ventas</h4>
            <li><a href="registrarVenta.php">Registrar Venta</a></li>          
          </ul>
        </div>
      </div>      
    </div>
    <!-- End Sidebar --> 
   </div>
  <!-- End Container -->
  
  <div id="copyright" class="opacity">
    <p>AutoGuayana, C.A. UCAB-Guayana</p>
  </div>
</div>
<!-- End Wrapper --> 

<script type="text/javascript" src="style/js/scripts.js"></script>
</body>
</html>
